{% extends 'base.html' %}

{% block title %}
    个人信息
{% endblock %}


{% block content %}
<div class="container normal-container">
    <div class="row">
        <div class="col-xs-8 col-xs-offset-2">
            {% if user.is_authenticated %}
                <div class="panel panel-default">
                    <!-- Default panel contents -->
                    <div class="panel-heading">用户信息</div>
                    <div class="panel-body">
                        <h4 style="color:#188a5f; font-weight: 600;">{{ user.username }}</h4>
                        <p>Hello~ <br/> 在这里，你可以快速看到或变更自己的信息，目前支持您修改昵称，或修改密码(直接点击即可修改)</p>
                        <p>有什么问题，请联系管理员:1046678590@qq.com</p>
                    </div>
          
                    <!-- List group -->
                    <div class="list-group">
                        <a href="{% url 'change_nickname' %}?from={{ request.get_full_path }}" class="list-group-item">
                            {% if user.profile.nickname %}昵称：{{ user.profile.nickname }}{% else %}暂无昵称{% endif %}
                        </a>
                        {% if user.email %}
                            <a href="#" class="list-group-item disabled">已绑定邮箱：{{ user.email }}</a>
                        {% else %}
                            <a href="{% url 'bind_email' %}" class="list-group-item">未绑定邮箱</a>
                        {% endif %}
                        <a href="#" class="list-group-item disabled">上次登录时间：{{ user.last_login|date:"Y-m-d G:i" }}</a>
                        <a href="{% url 'reset_password' %}?from={{ request.get_full_path }}" class="list-group-item">修改密码</a>
                    </div>
                </div>
            {% else %}
            <h3>您未登录，正在<a href="{% url 'home' %}">跳转</h3>...</span>
                <script type="text/javascript">
                    setTimeout("window.location.href = \"{% url 'home' %}\"", 2000);
                </script>
            {% endif %}
        </div>
    </div>
</div>

{% endblock %}